package indi.readbook.example.common.utils;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList;

public class UserLoginContainer {

    private static CopyOnWriteArrayList<String> userContainer = Lists.newCopyOnWriteArrayList();

    public static boolean putUserToken(String token) {
        return userContainer.add(token);
    }

    public static boolean exists(String token) {
        return userContainer.contains(token);
    }

    public static boolean removeUserToken(String token) {
        return userContainer.remove(token);
    }
}
